package com.an.homework;

public class HomeWork_6 {
    public static void main(String[] args) {
//        new Car().new Air().flow();
        Car car = new Car(20);
        Car car1 = new Car(-15);
        Car car2 = new Car(58);
        car.new Air().flow();
        car.getAir().flow();
        car1.new Air().flow();
        car1.getAir().flow();
        car2.getAir().flow();
        car2.new Air().flow();

    }
}

class Car{
    private double temperature;

    public Car(double temperature) {
        this.temperature = temperature;
    }

    class Air{
        public void flow(){
            if(temperature<0){
                System.out.println("吹暖风....");
            }
           else if(temperature>40){
                System.out.println("吹冷风.....");
            }
           else{
                System.out.println("关闭空调");
            }
        }
    }

    public Air getAir(){
        return new Air();
    }
}